@extends('admin.layout.common')
@section('content')
	<link rel="stylesheet" href="{{URL::asset('css/music/createSP.css')}}">
	<link rel="stylesheet" href="{{url('/common/css/element.css')}}">
	<!-- import Vue before Element -->
	<script src="{{url('/common/js/element/vue.js')}}"></script>
	<!-- import JavaScript -->
	<script src="{{url('/common/js/element/element.js')}}"></script>
	{{--jquery-validate--}}
	<div class="content">
		<h1 class="h1">创建SP</h1>
		<form id="formData" action="{{url('/admin/addSp')}}" method="post" enctype="multipart/form-data">
            {{csrf_field()}}
			<p>
				<label for="">*</label>
				<select name="sp_type" required>
					<option value="">SP性质选择</option>
					<option value ="1">音视大网站/APP</option>
					<option value ="2">短视频平台</option>
					<option value="3">电信运营商</option>
					<option value="4">协会</option>
					<option value="5">应用类APP</option>
					<option value="6">其他</option>
				</select>
				<label for="">*<input id="full_name" name="full_name" type="text" placeholder="SP全称" required /></label>
				<label for="">*<input name="simple_name" type="text" placeholder="SP简称" required/></label>
				<label for="">*</label>

				<select name="card_type" id="" value="证件种类" required>
					<option value="">证件种类</option>
					<option value="1">身份证</option>
					<option value="2">营业执照</option>
					<option value="3">护照</option>
					<option value="4">其他证件(海外)</option>
				</select>
				<label for="">*<input name="card" type="text" placeholder="证件号" required/></label>
			</p>
			<p>
				<label for="">*<input name="phone_name" type="text" placeholder="联系人" required/></label>
				<label for="">*<input name="phone" type="text" placeholder="联系电话" required/></label>
				<label for=""><input name="weixin" type="text" placeholder="微信"/></label>
				<label for=""><input name="weibo" type="text" placeholder="微博"/></label>
				<label for=""><input name="url" type="text" placeholder="网址"/></label>
			</p>
			<p>
				<label for="">*<input name="email" type="email" placeholder="商务email" required /></label>
				<label for=""><input name="email1" type="email" placeholder="财务email"/></label>
				<label for=""><input name="email2" type="email" placeholder="上线email"/></label>
			</p>
            <div class="informationBox">
                <div class="detailBox">
                    <label for="">*<input name="memory_day1" type="date" class="input_date"></label>
                    <i class="icon iconfont rili">&#xe614;</i>
                    <select name="memory_des1" id="">
                        <option value="生日">生日</option>
                        <option value="开业">开业</option>
                        <option value="主管生日">主管生日</option>
                    </select>
                    <i class="icon iconfont jiahao_1 addImg">&#xe600;</i>
                </div>
                <div class="detailBoxtwo" style="display:none;">
                    <label for="">*<input  name="memory_day2" type="date" class="input_date"></label>
                    <i class="icon iconfont rili">&#xe614;</i>
                    <select name="memory_des2" id="">
                        <option value="生日">生日</option>
                        <option value="开业">开业</option>
                        <option value="主管生日">主管生日</option>
                    </select>
                    <i class="icon iconfont jiahao_3 addImg">&#xe600;</i>
                </div>
                <div class="detailBoxthree" style="display:none;">
                    <label for="">*<input  name="memory_day3" type="date" class="input_date"></label>
                    <i class="icon iconfont rili">&#xe614;</i>
                    <select name="memory_des3" id="">
                        <option value="生日">生日</option>
                        <option value="开业">开业</option>
                        <option value="主管生日">主管生日</option>
                    </select>
                </div>
            </div>
			<p id="app" style="position: relative;">
				<label for="">*</label>
				<select name="check_cycle" id="" required>
					<option value="">对账周期</option>
					<option value="1">1月</option>
					<option value="2">2月</option>
					<option value="3">3月</option>
					<option value="4">6月</option>
					<option value="5">12月</option>
				</select>
                <input type="file" class="upload_file" name="agree_record" onchange="doChange(this)" style="display:none;" />
                <input class="photoCover" type="text" maxlength="0" placeholder="请上传协议" style="height:40px;width:219px;border:1px solid #ccc" required>
                <input type="button" onclick="$('input[class=upload_file]').click();" class="mybutton" value="协议备案" style="height:40px;width:125px;cursor:pointer;"/>

                <input type="file" class="upload_filetwo" name="document_record" onchange="doChangetwo(this)" style="display:none;" />
                <input class="photoCovertwo" maxlength="0" placeholder="请上传证件" type="text" style="height:40px;width:219px;border:1px solid #ccc" required>
                <input type="button" onclick="$('input[class=upload_filetwo]').click();" class="mybutton" value="证件备案" style="height:40px;width:125px;cursor:pointer;"/>
                <input name="fix_date" type="date" required style="width: 150px">
				<input name="expired_time" type="date" required style="width: 150px">
				{{--<i class="icon iconfont rili">&#xe614;</i>--}}
				{{--<select name="fix_choose" id="" required>--}}
					{{--<option value="">约期选择</option>--}}
					{{--<option value="1">1年</option>--}}
					{{--<option value="2">2年</option>--}}
					{{--<option value="3">3年</option>--}}
					{{--<option value="4">5年</option>--}}
					{{--<option value="5">7年</option>--}}
					{{--<option value="6">10年</option>--}}
				{{--</select>--}}
			</p>
			<p>
				<label for="">*</label>
				<select name="main" id="zhu" value="主管业员选择" required>
					<option value="">主营业员选择</option>
					<option value="无">无主营业员</option>
					@foreach($saleList as $k => $v)
                        @if($v['type'] == 1)
						<option value="{{$v['name']}}">{{$v['name']}}</option>
                        @endif
					@endforeach
				</select>
				<label for="">*</label>
				<select name="assist" id="fu" value="辅营业员选择">
					<option value="">辅营业员选择</option>
					@foreach($saleList as $k => $v)
                        @if($v['type'] == 2)
					    <option value="{{$v['name']}}">{{$v['name']}}</option>
                        @endif
					@endforeach
				</select>
				<label for="">*<input name="sp_email" type="email" placeholder="我司主管业务员邮箱" required/></label>
			</p>
			<p class="storage_box">
				<label for="">音乐文件：</label>
				<label for="">
					<input name="cstatus" type="checkbox" value="1">纯音乐
				</label>
				<label for="">
					<input name="ystatus" type="checkbox" value="1">音频
				</label>
				<label for="">
					<input name="bstatus" type="checkbox" value="1">伴奏
				</label>
				<label for="">
					<input name="mstatus" type="checkbox" value="1">MV
				</label>
				<label for="">
					<input name="kstatus" type="checkbox" value="1">卡拉OK
				</label>
				<label for="">
					<input name="dstatus" type="checkbox" value="1">短视频
				</label>
			</p>
			<div class="textarea_box">
				<div class="textarea_box_left">
					<label for="">合作简述：</label>
					<textarea name="work_sketch" id="text" cols="30" rows="10" placeholder="简述" required></textarea>
				</div>
				<div class="textarea_box_right">
					<label for="">添加备注：</label>
					<textarea name="remark" id="text" cols="30" rows="10"  placeholder="备注"></textarea>
				</div>
			</div>
			<p class="p1">
				<label><input type="checkbox" class="checkbox" required>我确定所有信息填写完整</label>
			</p>
			<p  class="p1" style="text-align: center;">
				<input type="submit" value="新增SP" class="liulan add">
			</p>
		</form>
	</div>
	<script src="{{url('js/music/createSp.js')}}"></script>
<script>
  $(function(){
    $('#zhu').change(function(){
      var val = $(this).val();
      $('#fu').find('option').each(function(index,item){
        if(val == $(item).val()) {
          $(item).attr('disabled',true)
        }else{
          $(item).attr('disabled',false)
        }
      })
    })
  })


    function doChange(file){
      var upload_file = $.trim($(".upload_file").val());    //获取上传文件
      $('.photoCover').val(upload_file);     //赋值给自定义input框
    }
    function doChangetwo(file){
        var upload_filetwo = $.trim($(".upload_filetwo").val());    //获取上传文件
        $('.photoCovertwo').val(upload_filetwo);     //赋值给自定义input框
    }

</script>
@endsection

